package com.lei.mvpmodel.presenter;

import com.lei.mvpmodel.model.IModel;
import com.lei.mvpmodel.view.IView;

public abstract class BasePresenter<M extends IModel,V extends IView> implements IPresenter {
    protected M mmodel;
    protected V mview;

    public BasePresenter(M mmodel, V mview) {
        this.mmodel = mmodel;
        this.mview = mview;
    }

    @Override
    public void destroy() {
        if (mmodel!=null){
            mmodel.destroy();
            mmodel = null;
        }
        if (mview!=null){
            mview = null;
        }
    }
}
